create or replace 
procedure copy_shop_new(
int_app_id in number,--应用ID
int_enterp_id in number,--企业ID
int_cate_id in number--要添加到的分类ID
) is
begin
  declare cursor temp_data_cur is select * from ENTERP_SHOP_TAB where INT_APP_ID=1611 and INT_CATE_ID=9001;
  shop_row ENTERP_SHOP_TAB%rowtype;
  int_content_id number;
  tocount number := 0;
  var_system_date varchar2(100);
  var_dynamic_sql varchar2(200);
  int_shop_id number;
  begin
    open temp_data_cur;
    loop
      fetch temp_data_cur into shop_row;
      exit when temp_data_cur%notfound;
      select to_char(sysdate,'yyyy-MM-dd HH24:mm:ss') into var_system_date from dual;
      --content表数据插入
      select CONTENT_TAB_SEQ.nextval into int_content_id from dual;
      Insert into CONTENT_TAB (INT_CONTENT_ID,VAR_CONTENT_NAME,INT_ENTERP_ID,INT_CATE_ID,INT_APP_ID,VAR_CONTENT_DESCRIPT,DAT_ADD_DATETIME,VAR_CONTENT_IMG_URL,INT_VIEW_COUNT,INT_ACTION,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,INT_RESOURCE_ID,INT_SORT_ORDER,INT_PRIVILEGE_USER,COMMENT_COUNT,FAV_COUNT,JOIN_COUNT) 
      values (int_content_id,shop_row.VAR_SHOP_NAME,int_enterp_id,int_cate_id,int_app_id,shop_row.VAR_DESC,var_system_date,shop_row.VAR_THUMB_IMG,0,null,0,var_system_date,shop_row.INT_SHOP_ID,0,0,0,0,0);
      tocount := tocount +1;
      int_shop_id := shop_row.INT_SHOP_ID;
      var_dynamic_sql := 'update ENTERP_SHOP_TAB e set e.INT_CONTENT_ID='||int_content_id||' where e.INT_APP_ID=1611 and e.INT_CATE_ID=9001 and e.INT_SHOP_ID='||int_shop_id;
      execute immediate var_dynamic_sql;
      dbms_output.put_line(int_content_id);
    end loop;
    dbms_output.put_line(tocount);
  end;
end;